﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using SoTools.Communicator.Messages;

namespace SoSlam.Common.Communication
{
	public static class KnownTypesHelper
	{
		private static IEnumerable<Type> _knownTypes;
		public static IEnumerable<Type> KnownTypes
		{
			get
			{
				return _knownTypes ?? (_knownTypes = Assembly.GetExecutingAssembly()
				                                     	.GetTypes()
				                                     	.Where(t => t.IsSubclassOf(typeof (BaseMessage))));
			}
		}
	}
}
